<template>
    <van-swipe
        :style="{width:width,height:height}"
        class="my-swipe"
        :autoplay="time"
        :show-indicators="show"
        :indicator-color="color"
    >
        <van-swipe-item v-for="(img,index) in images" :key="index">
            <img @click="detail" v-lazy="img" style="width:100%;height:100%" />
        </van-swipe-item>
    </van-swipe>
</template>

<script>
export default {
    name: "",
    props: {
        time: {
            type: Number,
            default: 3000
        },
        color: {
            type: String,
            default: "white"
        },
        show: {
            type: Boolean,
            default: true
        },
        images: {
            type: Array,
            defaule: []
        },
        width: {
            type: String,
            default: "100%"
        },
        height: {
            type: String,
            default: "100%"
        }
    },
    methods: {
        detail() {
            this.$router.push("/good/1");
        }
    },
    components: {},
    mounted() {},
    updated() {}
};
</script>

<style scoped>
.my-swipe .van-swipe-item {
    /* width: 375px;
    height: 150px; */
    color: #fff;
    font-size: 20px;
    line-height: 150px;
    text-align: center;
    /* background-color: #39a9ed; */
}
</style>
